﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Xpo;
using TaiLieu;
using System.IO;

public partial class tl_slideShow : System.Web.UI.UserControl
{
    public string listImg = "";
    public XPCollection<Category> list_Category = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        string _Query = QueryHelper.Get_Value(Request, 1);
        if (_Query == "")
            _Query = QueryString.gioiThieu;
        string path = Server.MapPath("~/"+QueryHelper.Get_Domain_1(Request)+"/FileUpload/slideShow/" + _Query + @"\");
        int dem = 0;
        foreach (FileInfo file in FileManagement.GetAllFileImg(path))
        {
            if (dem == 0)
            {
                listImg = @"<div class=""item current""><a href=""#""> <img src=""" + QueryHelper.Get_Domain_1(Request) + "/FileUpload/slideShow/" + _Query + "/" + file.Name + @""" alt="""+QueryHelper.Get_Domain_1(Request) +@""" /></a></div>"; dem++;
            }
            else
                listImg += @"<div class=""item ""><a href=""#""> <img src=""" + QueryHelper.Get_Domain_1(Request) + "/FileUpload/slideShow/" + _Query + "/" + file.Name + @""" alt=""" + QueryHelper.Get_Domain_1(Request) + @""" /></a></div>";
            // listImg += "FileUpload/slideShow/" + _Query +"/" +file.Name;
        }
        //string tam= @"<div class=""item current""><a href=""#""> <img src=""ecoliving/Images/slide-img.gif"" alt=""Ecoliving"" /></a>";
    }
}